<template>
    <div class="footerBar">
        <van-tabbar v-model="active">
            <van-tabbar-item name='index' to="/" icon='home-o'>管控</van-tabbar-item>
            <van-tabbar-item name='papers' icon='apps-o' to="/papers">发现</van-tabbar-item>
            <van-tabbar-item name='setting' icon='setting-o' to="/setting">设置</van-tabbar-item>
        </van-tabbar>
    </div>
</template>

<script>
export default {
    name:'FooterBar',
    data(){
        return{
            active: 'index'
        };
    },
    mounted(){
    switch(this.$route.path){
      case "/":
        this.active="index";
        break;
      case "/papers":
        this.active="papers";
        break;
      case "/setting":
        this.active="setting";
        break;      
      case "/":
          this.active="index";
          break;
       default:
           this.active="index"
    }
  }
}
</script>
